@layout("/common/_container.html"){
<style>
    .btnBox button {
        background: #30add1;
        color: white;
        width: 96px;
    }
</style>
<div class="ibox float-e-margins">
    <div style="display: none">
        <input type="hidden" id="sortMap" value="">
        <input type="hidden" id="reservationsId" value="${reservationsId}">
        <input type="hidden" id="customerId" value="${customerId}">
        <input type="hidden" id="operationTime" value="${operationTime}">
        <input type="hidden" id="getTime" value="${getTime}">
        <input type="hidden" id="totleFoldingPay" value="">
        <input type="hidden" id="totleServiceActualPay" value="">
        <input type="hidden" id="surplusAmount" value="0">
        <input type="hidden" id="startTime" value="">
        <input type="hidden" id="endTime" value="">
    </div>
    <div class="ibox-content">
        <div class="form-horizontal" id="addForm">
            <div>
                <div class="clearfix">
                    <div id="Div2" style="padding: 10px 0 20px;">
                        <div>
                            门诊：${consultantInfo.outpatientName}&nbsp
                            病历号：${consultantInfo.medicalRecordNumber}&nbsp
                            姓名：${consultantInfo.customerName}&nbsp
                            性别：${consultantInfo.sex}&nbsp
                            年龄：${consultantInfo.customerAge}&nbsp
                            电话：${consultantInfo.customerPhone}&nbsp
                            现场TC：${consultantInfo.tcName}
                        </div>
                    </div>

                    <div style="overflow:auto;border: 1px solid #dddddd;padding: 8px 15px;height: 380px;" class="panel">
                        <div id="openBillbutton">
                            <h3 style="color: black;">项目</h3>
                        </div>
                        <div id="openBillList"></div>
                        <div id="checkoutMethodDetails" class="row"></div>
                    </div>
                    <div style="display: flex;align-items: center">
                        <div id="openBillMoney" style="flex: 2"></div>
                        <div style="flex: 1">
                            结账金额合计：<input disabled="disabled" id="total" style="background: none;border: none;width: 100px;" value="0">元
                        </div>
                        <div style="flex: 1">
                            <div class="btnBox" style="text-align: right">
                                <button type="button" id="ensure" class="btn" onclick="Recharge.checkOut()">提交</button>
                                <button type="button" id="cancel" style="background: #999999" class="btn" id="cancel" onclick="Recharge.closes()">取消</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>


        </div>
    </div>
</div>

<link rel="stylesheet" href="${ctxPath}/static/css/jqui/jquery-ui.min.css">
<script src="${ctxPath}/static/js/jquery-ui.min.js"></script>
<script src="${ctxPath}/static/modular/arrival/customer/recharge.js"></script>
<script>
    $.ajax({
        url: Feng.ctxPath + "/consultant/getOpenBillListjz",
        type: "post",
        data: {
            "operationTime": $("#operationTime").val(),
            "customerId": $("#customerId").val(),
            "getTime": $("#getTime").val(),
            "reservationsId": $("#reservationsId").val()
        },
        success: function (data) {
            $('#openBillList').html("");
            var s1 = "";
            var ss = "";
            var s2 = "";
            for (var i = 0; i < data.length; i++) {
                ss += ' <div style="margin: 15px 0;">' +
                    '<span style="display: inline-block;width: 7%">'+data[i].department+'</span>'+
                    '<span style="display: inline-block;width: 9%">'+data[i].firstLevelProject+'</span>'+
                    '<span style="display: inline-block;width: 38%">'+data[i].payServiceName+'</span>'+
                    '<span style="display: inline-block;width: 5%">'+data[i].payServiceNum+'</span>'+
                    '<span style="display: inline-block;width: 11%">'+data[i].payService.toFixed(2)+'元</span>'+
                    '<span style="display: inline-block;width: 16%">应收金额：'+data[i].serviceActualPay+'</span>'+
                    '<span style="display: inline-block;width: 13%"><a style="color: #30add1;" href="javascript:;" onclick=\'Recharge.choiceCheckoutMethod("'+data[i].id+'")\'>[选择结账方式]</a></span>'+
                    '</div>';
            }
            s1 = ' <div style="display: flex">' +
                '<span style="flex: 1;">折后总金额：' + data[data.length - 1].totleFoldingPay.toFixed(2) + '元</span>' +
                '<span style="flex: 1;">应收金额：<span id="ysMoney">' + data[data.length - 1].totleServiceActualPay.toFixed(2) + '</span>元</span>' +
                '</div>';
            s2 = ' <div>成交状态：' + data[data.length - 1].dealStatus + '</div>';
            document.getElementById("totleFoldingPay").value = data[data.length - 1].totleFoldingPay;
            document.getElementById("totleServiceActualPay").value = data[data.length - 1].totleServiceActualPay;
//            $('#openBillbutton').html(s2);
            $('#openBillList').html(ss);
            $('#openBillMoney').html(s1);
        },
        error: function (data) {
            alert('内部故障!');
        }
    });
</script>
@}
